<!DOCTYPE html>
<html>
    <body>

        <p>Click the button to decode a URI after encoding it.</p>

        <button onclick="myFunction()">Try it</button>

        <p id="demo"></p>

        <script>
            function myFunction() {
                var uri = "http://w3schools.com/my test.asp?name=ståle&car=saab";
                var uri_enc = encodeURIComponent(uri);
                var uri_dec = decodeURIComponent("XML=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0D%0A%3CXML%3E%0D%0A+%3Credirecturl%3EUniversalDialogView%3C%2Fredirecturl%3E%0D%0A+%3CXMLFile%3Ebuyerconsole.BuyUpdateUserDialog%3C%2FXMLFile%3E%0D%0A+%3CuserId%3E1002%3C%2FuserId%3E%0D%0A+%3CpersonTitle%3E%3C%2FpersonTitle%3E%0D%0A+%3CfirstName%3EDIOSE%3C%2FfirstName%3E%0D%0A+%3CmiddleName%3E%3C%2FmiddleName%3E%0D%0A+%3ClastName%3ERAMIREZ%3C%2FlastName%3E%0D%0A+%3ClogonPassword%3E************%3C%2FlogonPassword%3E%0D%0A+%3ClogonPasswordVerify%3E************%3C%2FlogonPasswordVerify%3E%0D%0A+%3CchallengeQuestion%3E-%3C%2FchallengeQuestion%3E%0D%0A+%3CchallengeAnswer%3E-%3C%2FchallengeAnswer%3E%0D%0A+%3CpolicyAccountId%3E-1%3C%2FpolicyAccountId%3E%0D%0A+%3CuserStatus%3E0%3C%2FuserStatus%3E%0D%0A+%3CemployeeId%3E%3C%2FemployeeId%3E%0D%0A+%3CemployeeType%3E%3C%2FemployeeType%3E%0D%0A+%3CdepartmentNumber%3E%3C%2FdepartmentNumber%3E%0D%0A+%3Cmanager%3E%3C%2Fmanager%3E%0D%0A+%3Csecretary%3E%3C%2Fsecretary%3E%0D%0A+%3CpreferredLanguage%3E-5%3C%2FpreferredLanguage%3E%0D%0A+%3Caddress1%3EMZ.+H2+LOTE+26+URB.+SAN+DIEGO+LIMA%3C%2Faddress1%3E%0D%0A+%3Caddress2%3E%3C%2Faddress2%3E%0D%0A+%3Caddress3%3E%3C%2Faddress3%3E%0D%0A+%3Ccity%3ELIMA%3C%2Fcity%3E%0D%0A+%3Cstate%3ELIMET%3C%2Fstate%3E%0D%0A+%3CzipCode%3E150%3C%2FzipCode%3E%0D%0A+%3Ccountry%3EPE%3C%2Fcountry%3E%0D%0A+%3Cemail1%3ELUISLLAMOSAS@GMAIL.COM%3C%2Femail1%3E%0D%0A+%3Cemail2%3E%3C%2Femail2%3E%0D%0A+%3Cphone1%3E99466963%3C%2Fphone1%3E%0D%0A+%3Cphone2%3E%3C%2Fphone2%3E%0D%0A+%3Cfax1%3E%3C%2Ffax1%3E%0D%0A+%3Cfax2%3E%3C%2Ffax2%3E%0D%0A+%3CbestCallingTime%3EE%3C%2FbestCallingTime%3E%0D%0A%3C%2FXML%3E%0D%0A");
                var res = "Encoded URI: " + uri_enc + "<br><br><br>" + "Decoded URI: " + uri_dec;
                document.getElementById("demo").innerHTML = res;
            }
        </script>
    </body>
</html>
